﻿using System;

using System.Collections.Generic;
using System.Text;
using Silvermoon.OpenGL.Native;

namespace Silvermoon.OpenGL
{
    public class ClientState
    {
        internal ClientState() : base() { }

        public bool ColorArray
        {
            set { ChangeState(value, ClientStateArray.Color); }
        }

        public bool NormalArray
        {
            set { ChangeState(value, ClientStateArray.Normal); }
        }

        public bool TextureCoordArray
        {
            set { ChangeState(value, ClientStateArray.TextureCoord); }
        }

        public bool VertexArray
        {
            set { ChangeState(value, ClientStateArray.Vertex); }
        }

        private void ChangeState(bool value, ClientStateArray state)
        {
            if (value) gl.EnableClientState(state); else gl.DisableClientState(state);
        }
    }
}
